<include file="Login:header" />

<div class="subnav">
	<div class="content_menu ib_a blue line_x">
		<a href="{:U('training/index')}"><em>培训资料列表</em></a><span>|</span>
		<a href="{:U('training/add')}" class="on"><em>添加培训资料</em></a>
	</div>
</div>

<form id="info_form" action="{:U('training/add')}" method="post" enctype="multipart/form-data">
	<div class="pad_lr_10">
		<div class="col_tab">
			<div class="J_panes">
				<div class="content_list pad_10">
					<input name="id" type="hidden" value="{$info.id}">
					<table width="100%" cellspacing="0" class="table_form">
						<tr>
							<th style="border-bottom:none;">标题 :</th>
							<td style="border-bottom:none;">
								<input type="text" name="title" id="J_title" class="input-text" size="100" value="{$info.title}">
							</td>
						</tr>
						<tr>
							<th style="border-bottom:none;">内容 :</th>
							<td style="padding-top: 15px;border-bottom:none;"><textarea name="content" id="info" style="width:88%;height:400px;visibility:hidden;resize:none;">{$info.content}</textarea></td>
						</tr>
					</table>
					<div class="mt10">
						<input type="submit" value="提交" id="dosubmit" name="dosubmit" class="smt" style="margin:0 0 10px 115px;">
					</div>
				</div>

			</div>

		</div>
	</div>
</form>
<include file="Login:footer" />
<script src="__ROOT__/static/js/jquery/plugins/colorpicker.js"></script>
<script src="__ROOT__/static/js/kindeditor/kindeditor.js"></script>
<script src="__ROOT__/static/js/fileuploader.js"></script>
<script>
	$(function() {
		KindEditor.create('#info', {
			uploadJson : '{:U("upload/file_upload")}',
			fileManagerJson : '{:U("upload/file_manager")}',
			allowFileManager : true
		});
		$('ul.J_tabs').tabs('div.J_panes > div');
		//颜色选择器
		$('.J_color_picker').colorpicker();
	});
	var upload = new qq.FileUploaderBasic({
		allowedExtensions: ['pdf','doc','docx','xls','xlsx','txt','rar','zip','jpg','png','jpeg','gif'],
		button: document.getElementById('J_company_mobile_logo_upload'),
		multiple: false,
		action: "{:U('upload/file_upload')}",
		inputName: 'imgFile',
		forceMultipart: true, //用$_FILES
		messages: {
			typeError: lang.upload_type_error,
			sizeError: lang.upload_size_error,
			minSizeError: lang.upload_minsize_error,
			emptyError: lang.upload_empty_error,
			noFilesError: lang.upload_nofile_error,
			onLeave: lang.upload_onLeave
		},
		showMessage: function(message){
			$.yhxia.tip({content:message, icon:'error'});
		},
		onSubmit: function(id, fileName){
			$('#J_company_mobile_logo_upload').addClass('btn_disabled').find('span').text(lang.uploading);
		},
		onComplete: function(id, fileName, result){
			$('#J_company_mobile_logo_upload').removeClass('btn_disabled').find('span').text(lang.upload);
			if(result.error === 0){
				$('#show_company_mobile_logo').attr('src',result.url);
				$('#J_company_mobile_logo').val(result.url);
			}else{
				$.yhxia.tip({content:result, icon:'error'});
			}
		}
	});
</script>
</body>
</html>